package od_2024E;

import java.util.*;
import java.util.stream.Collectors;

/**
 * 题目：
 * file:///C:/Users/Lsz/Desktop/%E5%8D%8E%E4%B8%BAOD%E7%AC%94%E8%AF%95%E5%AE%9D%E5%85%B8/%E5%AE%9D%E5%85%B8/(E%E5%8D%B7,100%E5%88%86)%20-%20%E6%9F%A5%E6%89%BE%E6%8E%A5%E5%8F%A3%E6%88%90%E5%8A%9F%E7%8E%87%E6%9C%80%E4%BC%98%E6%97%B6%E9%97%B4%E6%AE%B5%EF%BC%88Java%20&%20Python&%20JS%20&%20C++%20&%20C%20%EF%BC%89.html
 * 提示：
 * 1、搞清楚边界以及和是怎么算的:
 * 1.1 求两个索引之间的和：累加和[j] - 累加和[i-1]
 * 1.2 如果 i == 0 ，求 i-j 的类加和，直接从累加和数组中拿
 * 2、搞清楚线段长度是 j - i  + 1
 */
public class Test02_zice01 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 获取minAverageLost 和 数组
        int midAverageLost = Integer.parseInt(scanner.nextLine());
        List<Integer> list = Arrays.stream(scanner.nextLine().split(" ")).map(Integer::parseInt).collect(Collectors.toList());

        // 获取累加和数组
        List<Integer> sumList = new ArrayList<>(list.size());
        sumList.add(list.get(0));
        for (int i = 1; i < list.size(); i++) {
            int sum = sumList.get(i - 1) + list.get(i);
            sumList.add(sum);
        }

        List<String> result = new ArrayList<>();
        int maxLength = 0;
        for (int i = 0; i < sumList.size(); i++) {
            for (int j = i; j < sumList.size(); j++) {
                int length = j - i + 1;
                int sum2 = length * midAverageLost;
                int zhensum = i == 0 ? sumList.get(j) : sumList.get(j) - sumList.get(i - 1);
                if (zhensum <= sum2) {
                    if (length > maxLength) {
                        maxLength = length;
                        if (!result.isEmpty()) {
                            result.clear();
                        }
                        result.add(i + "-" + j);
                    } else if (length == maxLength) {
                        result.add(i + "-" + j);
                    }
                }
            }
        }
        if (result.isEmpty()) {
            System.out.println("NULL");
        }
        if (!result.isEmpty()) {
            result.sort(new Comparator<String>() {
                @Override
                public int compare(String o1, String o2) {
                    return Integer.parseInt(o1.split("-")[0]) - Integer.parseInt(o2.split("-")[0]);
                }
            });
            for (int i = 0; i < result.size(); i++) {
                if (i < result.size() - 1) {
                    System.out.print(result.get(i) + " ");
                } else {
                    System.out.print(result.get(i));
                }
            }
        }

        scanner.close();
    }
}
